<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
	<f:loadBundle var="text" basename="#{basePage.bundleName}" />
	<head>
	<title>#{text['menu.shop.title']}</title>
	<meta name="heading" content="#{text['menu.shop.title']}" />
	</head>

	<body id="shopList">
	<div class="separator"></div>

	<h:form id="shopListForm">
	<h:commandButton value="#{text['button.add']}"
			action="#{shopForm.callCreate}" id="add" styleClass="button" />
		
		<t:dataTable id="shopTable" var="shop" style="margin-top: 10px" 
    			value="#{shopForm.shopList}" rows="25" styleClass="scrollerTable table"
    			headerClass="standardTable_Header" rowClasses="standardTable_Row1,standardTable_Row2"
    			columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnCentered">
    			
    			<t:column width="25%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="name" arrow="true">
                				<h:outputText value="#{text['shop.list.name']}" />
            				</t:commandSortHeader>
        				</f:facet>
        				<h:commandLink action="#{shopForm.callEditShop}" value="#{shop.name}" >
            				<f:param name="id" value="#{shop.id}"/>
        				</h:commandLink>
				</t:column>
				<t:column width="25%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="URL" arrow="true">
                				<h:outputText value="#{text['shop.list.url']}" />
            				</t:commandSortHeader>
        				</f:facet>
        				<h:outputLink value="#{shop.URL}"><h:outputText value="#{shop.URL}"/></h:outputLink>
				</t:column>
				<t:column width="25%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="description" arrow="true">
                				<h:outputText value="#{text['shop.list.description']}" />
            				</t:commandSortHeader>
        				</f:facet>
        					<h:outputText value="#{shop.description}"></h:outputText>
				</t:column>
				<t:column width="25%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="logo" arrow="true">
                				<h:outputText value="#{text['shop.list.logo']}" />
            				</t:commandSortHeader>
        				</f:facet>
        					<t:graphicImage url="/resource/image/${shop.logo.URI}"></t:graphicImage>
				</t:column>
    	</t:dataTable>		
	</h:form>
	</body>
</f:view>
</html>
